package com.live.service;

import java.util.List;

import com.live.dao.AdminDao;
import com.live.model.Admin;

public class AdminService {
	private AdminDao adminDao = new AdminDao();
	public Admin getAdmin(String account, String password) {
		return adminDao.getAdmin(account, password);
	}
	public Admin getAdminAccount(String account) {
		return adminDao.getAdminAccount(account);
	}
	public List<Admin> getAdminId() {
		return adminDao.getAdminId();
	}
	public List<Admin> getAdminName() {
		return adminDao.getAdminName();
	}
	public List<Admin> getAdminList(int pageIndex, int pageSize) {
		return adminDao.getAdminList(pageIndex, pageSize);
	}
	public int addAdmin(Admin admin) {
		return adminDao.addAdmin(admin);
	}
	public int editAdmin(Admin admin) {
		return adminDao.editAdmin(admin);
	}
	public int editAdminSpecial(Admin admin) {
		return adminDao.editAdminSpecial(admin);
	}
	public int editAdminSign(Admin admin) {
		return adminDao.editAdminSign(admin);
	}
	public int editAdminLandingTime(Admin admin) {
		return adminDao.editAdminLandingTime(admin);
	}
	public int editAdminPassword(Admin admin) {
		return adminDao.editAdminPassword(admin);
	}
	public int getTotalPage(int pageSize) {
		int totalCount = adminDao.getTotalCount();
		int totalPage = 0;
		if(totalCount % pageSize == 0 ){
			totalPage = totalCount / pageSize;	
		}else{
			totalPage = totalCount / pageSize + 1;
		}
			return totalPage;
	}
	public int getTotalCount(){
		return adminDao.getTotalCount();
	}
}
